#include <bits/stdc++.h>
// 2025/04/02
// tag:
// Author: Forever
using namespace std;
using int64 = int64_t;

int n, k;
bool dp[10001][2];
inline int mod(int x){
    return (x % k + k) % k;
}

void solve(){
    memset(dp, 0, sizeof(dp));
    cin >> n >> k;
    for (int i = 1; i <= n; i++){
        int a;
        cin >> a;
        if (i == 1){
            dp[mod(a)][i & 1] = true, dp[mod(-a)][i & 1] = true;
            continue;
        }
        for (int j = 0; j < k; j++)
            dp[j][i & 1] = dp[mod(j - a)][!(i & 1)] || dp[mod(j + a)][!(i & 1)]; 
    }
    if (dp[0][n & 1])
        cout << "Divisible" << endl;
    else
        cout << "Not divisible" << endl;
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int M;
    cin >> M;
    while (M--)
        solve();

    return 0;
}